<!doctype html>
<html lang="en">
<#include "../common/header.ftl">
<body>

<div id="wrapper" class="toggled">
<#include "../common/nav.ftl">

    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <table class="table table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th>
                                商品ID
                            </th>
                            <th>
                                名称
                            </th>
                            <th style="width: 110px">
                                图片
                            </th>
                            <th>
                                单价
                            </th>
                            <th>
                                库存
                            </th>
                            <th>
                                描述
                            </th>

                            <th>
                                类别
                            </th>
                            <th>
                                状态
                            </th>
                            <th colspan="2" style="text-align: center">
                                操作
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list productInfoPage.content as productinfo>
                        <tr>
                            <td style="text-align: center;padding-top: 40px">
                            ${productinfo.productId}
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                            ${productinfo.productName}
                            </td>
                            <td>
                                <img src="${productinfo.productIcon}" style="width: 100px;height: 100px;padding: 5px">
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                            ${productinfo.productPrice}
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                            ${productinfo.productStock}
                            </td>
                            <td style="text-align: center">
                            ${productinfo.productDescription}
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                            ${productinfo.categoryType}
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                            ${productinfo.getProductstatusenum().getMsg()}
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                                <a href="/sell/seller/product/index?productId=${productinfo.productId}">修改</a>
                            </td>
                            <td style="text-align: center;padding-top: 40px">
                                <#if productinfo.getProductstatusenum().getMsg()=="上架">
                                    <a href="/sell/seller/product/off_sale?productId=${productinfo.productId}">下架</a>
                                <#else>
                                    <a style="color: #c60023;"
                                       href="/sell/seller/product/on_sale?productId=${productinfo.productId}">上架</a>
                                </#if>

                            </td>

                        </tr>

                        </#list>
                        </tbody>
                    </table>
                </div>
                <div class="col-md-12 column">
                    <ul class="pagination pull-left">
                    <#if currentPage lte 1>
                        <li class="disabled">
                            <a href="#">上一页</a>
                        </li>
                    <#else>
                        <li>
                            <a href="/sell/seller/product/list?page=${currentPage-1}">上一页</a>
                        </li>
                    </#if>
                    <#list 1..productInfoPage.getTotalPages() as index>
                        <#if currentPage==index>
                            <li class="disabled">
                                <a href="#">${index}</a>
                            </li>
                        <#else>
                            <li>
                                <a href="/sell/seller/product/list?page=${index}">${index}</a>
                            </li>
                        </#if>
                    </#list>


                    <#if currentPage gte productInfoPage.getTotalPages()>
                        <li class="disabled">
                            <a href="#">下一页</a>
                        </li>
                    <#else>
                        <li>
                            <a href="/sell/seller/product/list?page=${currentPage+1}">下一页</a>
                        </li>
                    </#if>

                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>